# 协程
# pip install greenlet
# 安装greenlet
import time

from greenlet import greenlet
a = 10

def study():
    global a
    print(f'学习协程{a}')
    a *= 10
    g2.switch()
    print(f'还是不懂{a}')
    a *= 10
    g2.switch()

def listen():
    global a
    print(f'他在听嫂子{a}')
    a *= 10
    g1.switch()
    print(f'不停打扰我{a}')


g1 = greenlet(study)
g2 = greenlet(listen)



g1.switch()














